Java threads and the JDBC driver - Mailing list pgsql-interfaces

From Herouth Maoz
Subject Java threads and the JDBC driver
Date
Msg-id l03110704b222c3e19580@[147.233.159.109]
Whole thread Raw
Responses Re: [INTERFACES] Java threads and the JDBC driver  (Peter T Mount <peter@retep.org.uk>)
List pgsql-interfaces
As I understand it, the JDBC driver is not thread safe.

I am trying to figure out how much synchronization I need.

Is it safe to use separate ResultSets that originate from the same
Connection object concurrently? That is, lock the connection object, create
and perform the query into a new ResultSet, unlock the connection, and
proceed to use the ResultSet? If I do that, other threads may be issuing
queries while I'm still looping on the ResultSet.

It's supposed to be OK. But is it?

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



pgsql-interfaces by date:

Previous
From: "Eric H. Buschelmann"
Date:
Subject: Thanks
Next
From: Peter T Mount
Date:
Subject: Re: [INTERFACES] Java threads and the JDBC driver